package com.xjzd.spring.validated;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.List;

@Data
public class Address {
    @NotEmpty
    private String country;
    @NotEmpty
    private String province;
    private String city;

    @NotEmpty
    @Valid
    private List<TimeoutHandler> handler;


    @Data
    public static class TimeoutHandler {
        @NotNull(message = "任务超时未处理的行为不能为空")
        private Integer type;
    }
}